package com.example.questionnaire.mbg.comman;

import lombok.Data;

@Data
public class R {
    private int code;
    private Object data;
    private String msg;

    public R(int code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public static R success(Object data) {
        return new R(200, data, "");
    }

    public static R fail(String msg) {
        return new R(500, null, msg);
    }

    public static R success() {
        return new R(200, null, "");
    }
}
